=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 05-12-93 (15:17) Number: 54 From: LUIS ESPINOZA Refer#: 194 To: ADAM DAVILA Recvd: NO Subj: QBASIC (COPYING FILES WIT Conf: (35) Quick Basi --------------------------------------------------------------------------- On (11 May 93) Adam Davila wrote to All... AD> Is there anyone out there who can tell me how to get a percentage AD> count (i.e 10%..20%..30%..etc.) when using this loop to copy files AD> from within QBasic: AD> AD> OPEN "FILE1.EXT" FOR INPUT AS #1 AD> OPEN "FILE2.EXT" FOR OUTPUT AS #2 AD> DO WHILE NOT EOF(1) AD> LINE INPUT #1, VARIABLE$ AD> PRINT #2, VARIABLE$ AD> LOOP AD> CLOSE AD> AD> You know I used to use the same routine Until someone here on the Echo showed me a faster way. Anyways here is one with a percentile bar. Tell me how you like this.... Luis Espinoza DECLARE SUB PrcCopy (Src$, Dst$) DEFINT A-Z PrcCopy "BT.EXE", "AE.CPY" 'Copy BT.EXE to AE.CPY SUB PrcCopy (Src$, Dst$) DIM Lcr AS LONG OPEN Src$ FOR BINARY AS #1 OPEN Dst$ FOR BINARY AS #2 ' Delete File if exists CLOSE #2 ' If exists create KILL Dst$ ' and kill OPEN Dst$ FOR BINARY AS #2 PRINT PRINT "Copying '"; Src$; "' to '"; Dst$; "' "; C = CSRLIN p = POS(0) PrcS=25 'This is the Size for the Bar Per$ = STRING$(PrcS, 176) 'This is the Percentile Bar PRINT Per$; fs1 = 8092 'Buffer Length a$ = SPACE$(fs1) 'Create our buffer Ctr = 1 'Percentile Bar Counter Lcr = LOF(1) \ PrcS DO WHILE fs1 'And our Copy Routine IF (LOF(1) - LOC(2)) < fs1 THEN fs1 = LOF(1) - LOC(2): a$ = SPACE$(fs1) GET #1, , a$ DO WHILE LOC(2) > Lcr Lcr = Lcr + (LOF(1) \ PrcS) MID$(Per$, Ctr, 1) = CHR$(219) Ctr = Ctr + 1 LOOP LOCATE C, p PRINT Per$; PUT #2, , a$ LOOP CLOSE #1 CLOSE #2 END SUB --- PPoint 1.37 * Origin: Ward-B (SoCal) - (909) 793-xxxx - Pvt (1:207/213.5) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 575 950 203/23 209/209 SEEN-BY: 261/1023 280/1 390/1 396/1 15 397/2 2230/100 2440/5 3603/20